package abstractEntities;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;

import entities.Award;
import entities.Charater;
import entities.Complaint;
import entities.Departamentleader;
import entities.Inventory;
import entities.Leveldepartament;
import entities.Mastercoach;
import entities.Student;
import entities.Team;
import entities.Tutorial;
import entities.Userranking;
import entities.Userteam;
import entities.Usertutorial;

/**
 * AbstractUser entity provides the base persistence definition of the User
 * entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass
public abstract class AbstractUser implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 1712585193281500862L;
	private Integer idUser;
	private Inventory inventory;
	private String email;
	private String password;
	private String nickname;
	private String idFacebook;
	private String firstName;
	private String lastName;
	private String photo;
	private Integer totalPoints;
	private Date dateLastActivity;
	private Set<Tutorial> tutorialsForIdAuthor = new HashSet<Tutorial>(0);
	private Set<Tutorial> tutorialsForIdValidator = new HashSet<Tutorial>(0);
	private Set<Userranking> userrankingsForIdUser3 = new HashSet<Userranking>(
			0);
	private Set<Userranking> userrankingsForIdUser4 = new HashSet<Userranking>(
			0);
	private Set<Complaint> complaints = new HashSet<Complaint>(0);
	private Set<Userranking> userrankingsForIdUser1 = new HashSet<Userranking>(
			0);
	private Set<Userranking> userrankingsForIdUser2 = new HashSet<Userranking>(
			0);
	private Set<Charater> charaters = new HashSet<Charater>(0);
	private Set<Userranking> userrankingsForIdUser5 = new HashSet<Userranking>(
			0);
	private Set<Team> teams = new HashSet<Team>(0);
	private Set<Departamentleader> departamentleaders = new HashSet<Departamentleader>(
			0);
	private Set<Mastercoach> mastercoachs = new HashSet<Mastercoach>(0);
	private Set<Student> students = new HashSet<Student>(0);
	private Set<Award> awards = new HashSet<Award>(0);
	private Set<Userteam> userteams = new HashSet<Userteam>(0);
	private Set<Usertutorial> usertutorials = new HashSet<Usertutorial>(0);
	private Set<Leveldepartament> leveldepartaments = new HashSet<Leveldepartament>(
			0);

	// Constructors

	/** default constructor */
	public AbstractUser() {
	}

	/** minimal constructor */
	public AbstractUser(Inventory inventory, String email, String password,
			String nickname, String firstName, String lastName,
			Integer totalPoints) {
		this.inventory = inventory;
		this.email = email;
		this.password = password;
		this.nickname = nickname;
		this.firstName = firstName;
		this.lastName = lastName;
		this.totalPoints = totalPoints;
	}

	/** full constructor */
	public AbstractUser(Inventory inventory, String email, String password,
			String nickname, String idFacebook, String firstName,
			String lastName, String photo, Integer totalPoints,
			Date dateLastActivity, Set<Tutorial> tutorialsForIdAuthor,
			Set<Tutorial> tutorialsForIdValidator,
			Set<Userranking> userrankingsForIdUser3,
			Set<Userranking> userrankingsForIdUser4, Set<Complaint> complaints,
			Set<Userranking> userrankingsForIdUser1,
			Set<Userranking> userrankingsForIdUser2, Set<Charater> charaters,
			Set<Userranking> userrankingsForIdUser5, Set<Team> teams,
			Set<Departamentleader> departamentleaders,
			Set<Mastercoach> mastercoachs, Set<Student> students,
			Set<Award> awards, Set<Userteam> userteams,
			Set<Usertutorial> usertutorials,
			Set<Leveldepartament> leveldepartaments) {
		this.inventory = inventory;
		this.email = email;
		this.password = password;
		this.nickname = nickname;
		this.idFacebook = idFacebook;
		this.firstName = firstName;
		this.lastName = lastName;
		this.photo = photo;
		this.totalPoints = totalPoints;
		this.dateLastActivity = dateLastActivity;
		this.tutorialsForIdAuthor = tutorialsForIdAuthor;
		this.tutorialsForIdValidator = tutorialsForIdValidator;
		this.userrankingsForIdUser3 = userrankingsForIdUser3;
		this.userrankingsForIdUser4 = userrankingsForIdUser4;
		this.complaints = complaints;
		this.userrankingsForIdUser1 = userrankingsForIdUser1;
		this.userrankingsForIdUser2 = userrankingsForIdUser2;
		this.charaters = charaters;
		this.userrankingsForIdUser5 = userrankingsForIdUser5;
		this.teams = teams;
		this.departamentleaders = departamentleaders;
		this.mastercoachs = mastercoachs;
		this.students = students;
		this.awards = awards;
		this.userteams = userteams;
		this.usertutorials = usertutorials;
		this.leveldepartaments = leveldepartaments;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "idUser", unique = true, nullable = false)
	public Integer getIdUser() {
		return this.idUser;
	}

	public void setIdUser(Integer idUser) {
		this.idUser = idUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idInventory", nullable = false)
	public Inventory getInventory() {
		return this.inventory;
	}

	public void setInventory(Inventory inventory) {
		this.inventory = inventory;
	}

	@Column(name = "email", unique = true, nullable = false, length = 50)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "password", nullable = false, length = 50)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "nickname", unique = true, nullable = false, length = 50)
	public String getNickname() {
		return this.nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	@Column(name = "idFacebook", unique = true, length = 75)
	public String getIdFacebook() {
		return this.idFacebook;
	}

	public void setIdFacebook(String idFacebook) {
		this.idFacebook = idFacebook;
	}

	@Column(name = "firstName", nullable = false, length = 25)
	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@Column(name = "lastName", nullable = false, length = 25)
	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Column(name = "photo")
	public String getPhoto() {
		return this.photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	@Column(name = "totalPoints", nullable = false)
	public Integer getTotalPoints() {
		return this.totalPoints;
	}

	public void setTotalPoints(Integer totalPoints) {
		this.totalPoints = totalPoints;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "dateLastActivity", length = 10)
	public Date getDateLastActivity() {
		return this.dateLastActivity;
	}

	public void setDateLastActivity(Date dateLastActivity) {
		this.dateLastActivity = dateLastActivity;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userByIdAuthor")
	public Set<Tutorial> getTutorialsForIdAuthor() {
		return this.tutorialsForIdAuthor;
	}

	public void setTutorialsForIdAuthor(Set<Tutorial> tutorialsForIdAuthor) {
		this.tutorialsForIdAuthor = tutorialsForIdAuthor;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userByIdValidator")
	public Set<Tutorial> getTutorialsForIdValidator() {
		return this.tutorialsForIdValidator;
	}

	public void setTutorialsForIdValidator(Set<Tutorial> tutorialsForIdValidator) {
		this.tutorialsForIdValidator = tutorialsForIdValidator;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userByIdUser3")
	public Set<Userranking> getUserrankingsForIdUser3() {
		return this.userrankingsForIdUser3;
	}

	public void setUserrankingsForIdUser3(
			Set<Userranking> userrankingsForIdUser3) {
		this.userrankingsForIdUser3 = userrankingsForIdUser3;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userByIdUser4")
	public Set<Userranking> getUserrankingsForIdUser4() {
		return this.userrankingsForIdUser4;
	}

	public void setUserrankingsForIdUser4(
			Set<Userranking> userrankingsForIdUser4) {
		this.userrankingsForIdUser4 = userrankingsForIdUser4;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Complaint> getComplaints() {
		return this.complaints;
	}

	public void setComplaints(Set<Complaint> complaints) {
		this.complaints = complaints;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userByIdUser1")
	public Set<Userranking> getUserrankingsForIdUser1() {
		return this.userrankingsForIdUser1;
	}

	public void setUserrankingsForIdUser1(
			Set<Userranking> userrankingsForIdUser1) {
		this.userrankingsForIdUser1 = userrankingsForIdUser1;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userByIdUser2")
	public Set<Userranking> getUserrankingsForIdUser2() {
		return this.userrankingsForIdUser2;
	}

	public void setUserrankingsForIdUser2(
			Set<Userranking> userrankingsForIdUser2) {
		this.userrankingsForIdUser2 = userrankingsForIdUser2;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Charater> getCharaters() {
		return this.charaters;
	}

	public void setCharaters(Set<Charater> charaters) {
		this.charaters = charaters;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userByIdUser5")
	public Set<Userranking> getUserrankingsForIdUser5() {
		return this.userrankingsForIdUser5;
	}

	public void setUserrankingsForIdUser5(
			Set<Userranking> userrankingsForIdUser5) {
		this.userrankingsForIdUser5 = userrankingsForIdUser5;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Team> getTeams() {
		return this.teams;
	}

	public void setTeams(Set<Team> teams) {
		this.teams = teams;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Departamentleader> getDepartamentleaders() {
		return this.departamentleaders;
	}

	public void setDepartamentleaders(Set<Departamentleader> departamentleaders) {
		this.departamentleaders = departamentleaders;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Mastercoach> getMastercoachs() {
		return this.mastercoachs;
	}

	public void setMastercoachs(Set<Mastercoach> mastercoachs) {
		this.mastercoachs = mastercoachs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Student> getStudents() {
		return this.students;
	}

	public void setStudents(Set<Student> students) {
		this.students = students;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinTable(name = "awarduser", catalog = "skillworld", joinColumns = { @JoinColumn(name = "idUser", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "idAward", nullable = false, updatable = false) })
	public Set<Award> getAwards() {
		return this.awards;
	}

	public void setAwards(Set<Award> awards) {
		this.awards = awards;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Userteam> getUserteams() {
		return this.userteams;
	}

	public void setUserteams(Set<Userteam> userteams) {
		this.userteams = userteams;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Usertutorial> getUsertutorials() {
		return this.usertutorials;
	}

	public void setUsertutorials(Set<Usertutorial> usertutorials) {
		this.usertutorials = usertutorials;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Leveldepartament> getLeveldepartaments() {
		return this.leveldepartaments;
	}

	public void setLeveldepartaments(Set<Leveldepartament> leveldepartaments) {
		this.leveldepartaments = leveldepartaments;
	}

}